home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20000114-20000217
/
000279_news@columbia.edu _Wed Feb 16 15:10:29 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2000-02-16
|
3KB
Return-Path: <news@columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id PAA03291
for <kermit.misc@watsun.cc.columbia.edu>; Wed, 16 Feb 2000 15:10:29 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id MAA01157
for kermit.misc@watsun.cc.columbia.edu; Tue, 15 Feb 2000 12:36:50 -0500 (EST)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Subject: Re: pb with script programming,
Date: 15 Feb 2000 17:36:46 GMT
Organization: Columbia University
Message-ID: <88c2re$142$1@newsmaster.cc.columbia.edu>
To: kermit.misc@columbia.edu
In article <88c1mo$o8c$1@wanadoo.fr>, AMT <amt.mhn@netcourrier.com> wrote:
: i wirk on an hp/ux 10.0 workstation
:
And C-Kermit? Which version? The current version is 7.0:
http://www.columbia.edu/kermit/ckermit.html
: I want to make the same commands to differents nodes of my network
:
: i have coded the script
: ..
: cat /etc/hosts | while read LIGNE
: do
: EQUIP= echo $LIGNE | awk '{print $2}'`
: CMDE="set host $EQUIP, take /filexx"
: kermit -c "$CMDE";
: echo "AAAAA"
: done
: echo "BBBBB""
: exit
:
I think in "kermit -c" you need an uppercase 'C'.
However, this is not the best way to execute a C-Kermit script in Unix.
Please visit:
http://www.columbia.edu/kermit/ckscripts.html
to find out how to construct and invoke your C-Kermit scripts exactly as
if they were shell scripts.
: the filexx have
: def unix do vax, set term byte 7
: set input timeout-action proceed
: .....
:
: set exit warning off
:
: input 1 ok
: if success go to suit
: end
: :suit
: ...
: ...
: end
:
: when all the nodes are up it's ok, but when the node "n" is down i have the
: message : unable to connect to "n"
: connection time-out. i go back to my script and it execute echo AAAAA echo
: BBBBB and it ends. so i havent made my commands to the nodes n+1 n+2 .....
:
: who can help me ?
:
Where is the list of nodes coming from?
Personally, I would recode the script as a Kermit script (no shell
scripting), put the list of nodes in an array, and loop through the array.
Example:
#!/usr/local/bin/kermit +
declare \&n[] = node1 node2 node3 node4 ...
for \%i 1 \fdim(&n) 1 {
set host \&n[\%i]
if fail {
(commands to execute if node can't be reached)
} else {
(commands to execute if connection to node was successful)
}
}
exit 0
Of course you can also have the script read the list of nodes from a file,
or get it from an environment variable, receive them as command-line arguments,
or any other way you like. Here is how to do it with command-line arguments:
#!/usr/local/bin/kermit +
for \%i 1 \v(argc) 1 {
set host \&_[\%i] ; This is the array of command-line arguments
if fail {
(commands to execute if node can't be reached)
} else {
(commands to execute if connection to node was successful)
}
}
exit 0
For details, see the script programming chapters of "Using C-Kermit":
http://www.columbia.edu/kermit/ck60manual.html
and the C-Kermit 7.0 update notes:
http://www.columbia.edu/kermit/ckermit2.html
- Frank